<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2018/10/13
 * Time: 9:28
 */
header("Content-Type:text/html;charset=utf-8");
include 'includes/init.php';

$control = empty($_REQUEST['control']) ? '' : $_REQUEST['control'];

if ($control == 'hint'){
//    $hint = $_REQUEST['hint'];
    $sql = "select * from t_member where rule_id = 3";

    $infoAll = $db_Obj->getall($sql);
    if (!empty($infoAll)){
//        var_dump($infoAll);
        $data = array();
        foreach ($infoAll as $item=>$value){
//            array_push($data,array('id' => $value['id'],'names' => $value['names']));
            $id = $value['id'];
            $name = $value['names'];
            $data[] = "<option id=$id value='$name'></option>";
        }
        $back = array(
            'code' => 200,
            'data' => $data
        );
    } else {
        $back = array(
            'code' => 100,
            'data' => null
        );
    }
    echo json_encode($back);
}